function EFFECT:Init(data)

	self.Heirach = data:GetEntity()
	self.Entity:SetPos(data:GetOrigin())
	self.Color = Color(data:GetStart().x, data:GetStart().y, data:GetStart().z, 255)
	self.Size = data:GetRadius()
	self.Normal = data:GetNormal()
	
	if (self.Heirach != NULL) and (self.Heirach:IsValid()) then
		self.Entity:SetParent(self.Heirach)
		self.Velocity = self.Heirach:GetVelocity()
	end
	
	self.LifeTime = data:GetMagnitude()
	self.Holdtime = data:GetScale()
	self.StartTime = CurTime()
	
	self.Mat1 = Material("Sprites/glow06")
	self.Mat2 = Material("Sprites/light_glow01")
	
	self.Mat1:SetMaterialInt("$spriterendermode",5)
	self.Mat1:SetMaterialInt("$illumfactor",8)
	
	self.Mat2:SetMaterialInt("$spriterendermode",5)
	self.Mat2:SetMaterialInt("$illumfactor",8)
	
	self.Alpha = 1
	
	local spritemat = Material("Sprites/glow01")
	spritemat:SetMaterialInt("$spriterendermode",5)
	spritemat:SetMaterialInt("$illumfactor",8)
	
	local emitter = ParticleEmitter(self.Entity:GetPos())
		for i=1,15 do
			local particle = emitter:Add("Sprites/glow01", self.Entity:GetPos())
			particle:SetColor(self.Color.r, self.Color.g, self.Color.b, self.Color.a)
			particle:SetVelocity((self.Normal * self.Size) + (self.Entity:RndNormalVector() * (self.Size * 0.8)) + (self.Velocity or Vector(0, 0, 0)))
			particle:SetDieTime(self.LifeTime * 2)
			particle:SetLifeTime(math.Rand(0, self.Holdtime))
			particle:SetStartSize(math.Rand(0, self.Size/2))
			particle:SetEndSize(0)
			particle:SetStartAlpha(255)
			particle:SetEndAlpha(0)
		end
	
	local boundlimit = Vector(32768,32768,32768)
	self.Entity:SetRenderBoundsWS(-1*boundlimit,boundlimit)
end

function EFFECT:RndNormalVector()
	local Vect = Vector()
	Vect.x = math.Rand(-1,1)
	Vect.y = math.Rand(-1,1)
	Vect.z = math.Rand(-1,1)
	return Vect
end

function EFFECT:Think()
	if (self.Alpha <= 0) then
		return false
	else
		self.Alpha = 1 - math.Clamp(((CurTime() - (self.StartTime + self.Holdtime)) / self.LifeTime), 0, 1)
		return true
	end
end

function EFFECT:Render()
	
	self.Color.a = self.Alpha * 255
	
	render.SetMaterial(self.Mat1)
	render.DrawSprite(self.Entity:GetPos(), self.Size, self.Size, self.Color)
	
	render.SetMaterial(self.Mat2)
	render.DrawSprite(self.Entity:GetPos(), self.Size, self.Size, self.Color)
					 
end
